﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using IEstate.Core.Models;

namespace IEstate.Web.Models
{
    public class EstateViewModel
    {
        [DisplayName("Street")]
        [Required(ErrorMessage="Please specify street")]
        public string Street { get; set; }

        [DisplayName("City")]
        [Required(ErrorMessage = "Please specify city")]
        public string City { get; set; }

        [DisplayName("Category")]
        [Required(ErrorMessage = "Please specify category")]
        public Category Category { get; set; }

        [DisplayName("Option")]
        [Required(ErrorMessage = "Please specify option")]
        public Option Option { get; set; }

        [DisplayName("Price")]
        [Required(ErrorMessage="Please specify price")]
        [RegularExpression("^[0-9]+$")]
        public decimal? Price { get; set; }

        [DisplayName("Size")]
        [Required(ErrorMessage="Please specify size")]
        [RegularExpression("^[0-9]+$")]
        public decimal? Size { get; set; }

        [DisplayName("Bedrooms")]
        [RegularExpression("^[0-9]*$")]
        public int? Bedrooms { get; set; }

        public byte[] ImageData { get; set; }
        public string ImageMimeType { get; set; }

        [DisplayName("Additional information")]
        [DataType(DataType.MultilineText)]
        public string Info { get; set; }

        [DisplayName("Promotional")]
        public bool? Promotional { get; set; }

        // Used only for security reasons
        public int HowMany { get; set; }
        public int SecretID { get; set; }
    }
}